package com.service.device;

import com.common.ErrorCodeEnum;
import com.common.emums.DataStatus;
import com.common.exception.BusinessException;
import com.common.utils.StringUtils;
import com.core.springSecurity.common.SecurityUtils;

import com.dao.secondary.device.DevicePcbExFactoryDtuPoolInfoMapper;
import com.model.domain.device.GetDevicePcbExFactoryDtuPoolInfoDO;
import com.model.pojo.device.DevicePcbExFactoryDtuPoolInfo;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import com.github.pagehelper.PageHelper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;



/**
 * @Author: zql
 * @Description: 安卓版出厂设备号池信息服务
 * @Data: 2024-03-12
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class DevicePcbExFactoryDtuPoolInfoService {
    private final DevicePcbExFactoryDtuPoolInfoMapper devicePcbExFactoryDtuPoolInfoMapper;
    public List<DevicePcbExFactoryDtuPoolInfo> getPageList(GetDevicePcbExFactoryDtuPoolInfoDO getDevicePcbExFactoryDtuPoolInfoDO){
        PageHelper.clearPage();
        PageHelper.startPage(getDevicePcbExFactoryDtuPoolInfoDO.getPage(),getDevicePcbExFactoryDtuPoolInfoDO.getPageSize(),getDevicePcbExFactoryDtuPoolInfoDO.getSortRow()+getDevicePcbExFactoryDtuPoolInfoDO.getSortOrder());
        return devicePcbExFactoryDtuPoolInfoMapper.selectList(getDevicePcbExFactoryDtuPoolInfoDO);
    }
    public List<DevicePcbExFactoryDtuPoolInfo> getAllList(GetDevicePcbExFactoryDtuPoolInfoDO getDevicePcbExFactoryDtuPoolInfoDO){
        PageHelper.clearPage();
        return devicePcbExFactoryDtuPoolInfoMapper.selectList(getDevicePcbExFactoryDtuPoolInfoDO);
    }

    public DevicePcbExFactoryDtuPoolInfo getByShortDtu(String shortDtu){
        return devicePcbExFactoryDtuPoolInfoMapper.selectByShortDtu(shortDtu);
    }
    public DevicePcbExFactoryDtuPoolInfo getByDtu(String dtu){
        return devicePcbExFactoryDtuPoolInfoMapper.selectByDtu(dtu);
    }
    public void saveList(List<DevicePcbExFactoryDtuPoolInfo> list){
        devicePcbExFactoryDtuPoolInfoMapper.insertListSelective(list);
    }
    public void updateList(List<DevicePcbExFactoryDtuPoolInfo> list){
        devicePcbExFactoryDtuPoolInfoMapper.updateListSelective(list);
    }
}
